package com.baseframe.score.mapper;

import com.baseframe.score.entity.SnsSign;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**

* @description 针对表【sns_sign(用户签到表)】的数据库操作Mapper
* @createDate 2023-06-26 00:45:34
* @Entity com.baseframe.score.entity.SnsSign
*/
public interface SnsSignMapper extends BaseMapper<SnsSign> {

    @Select("select ss.id, ss.user_id, ss.sign_time from sns_sign as ss where ss.user_id = #{userId} order by ss.sign_time desc limit 1")
    SnsSign getLastSign(@Param("userId") Long userId);
}




